<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>删除数组中最后一个元素 - pop()</title>
</head>

<body>
    <h1>JavaScript 数组方法</h1>
    <h2>pop()</h2>
    <p>pop() 方法从数组中删除最后一个元素。</p>
    <p id="demo1"></p>
    <p id="demo2"></p>
    <script>
        var fruits = ["A", "Q"];
        document.getElementById("demo1").innerHTML = fruits;
        fruits.pop();
        document.getElementById("demo2").innerHTML = fruits;
    </script>
</body>

</html>